<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class PenerimaanObatModel extends zulModel{

	function __construct(){
			parent::__construct();
			$this->table_name	= "penerimaan_obat";
			$this->primary_key	= "ID_PENERIMAAN_OBAT";
			$this->order_by		= "penerimaan_obat.ID_PENERIMAAN_OBAT ASC"; 
	}
	function gridPenerimaanObat(){
		$this->db->select('*');
		$this->db->from('penerimaan_obat');
		$this->flexigrid->build_query();
		$return['records'] = $this->db->get();
		
		$this->db->select('*');
		$this->db->from('penerimaan_obat');
		$this->flexigrid->build_query(FALSE);
		$return['record_count'] = $this->db->count_all_results();

		return $return;
	}
	function get_group($val,$key){
		$this->db->select("*");
		$this->db->where($val);
		$this->db->group_by($key);
		return $this->db->get($this->table_name)->result_array();
	}
}
?>